<!doctype html>
<html>
  <head>
    <meta charset="UTF-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
    <title>舆情工作平台</title>
    <link rel="stylesheet" type="text/css" href="../css/api.css" />
    <link rel="stylesheet" type="text/css" href="../css/common.css" />   
    <style>     
     
     /* 头部样式 */
     .topbar {background: #3A8B7A; height:50px; border-bottom: 1px solid #DDDFE3; }
     #title { color:#FFF;} 
     .swipe {line-height: 50px;margin-right: 10px;color: #FF8400;}
     .back {float: left; padding-right: 30px;}
     .back img {height: 30px;margin-top: 10px;margin-left: 10px;margin-bottom: 10px;}
     .topbar .title {line-height: 50px; font-size: 22px;  position: absolute; left: 50%; -webkit-transform: translateX(-50%);transform: translateX(-50%);}
      
     /* 底部切换按钮样式 */
      #footer{
            height: 50px;
            background-color: #9f9f9f;
            width: 100%;
            text-align: center;
            display: -webkit-box;
            display: -webkit-flex;
            display: flex;
            border-top:1px solid #dbdcdc;
            -webkit-box-orient: horizontal;
            -webkit-flex-flow: row;
            flex-flow: row;
        }
        #footer span{
            display: block; 
            line-height: 50px;
            font-size: 14px;       
            -webkit-box-flex: 1;
            -webkit-flex: 1;
            flex: 1;
            background-repeat: no-repeat;
            background-position: center 10px;
            background-size: 36px !important;
            -webkit-background-size: 36px !important;
            color:#fff;
        }
        /*#footer span.active, #footer span.act{*/
            /*background-color: #2dbd82; color: #fff;*/
        /*}*/
        #footer span:last-child{
            border-right: 0;
        }
         
     
        #footer .preview.active, #footer .preview.act{
             background:#3A8B7A;
        }
        #footer .code.active, #footer .code.act{
             background:#3A8B7A;
        }
     

    </style>
  </head>
  <body>
    <div id="wrap">  
      <div id="thridHeader" class="titlebar activebar">
        <div class="topbar whitebar">
          <div class="back"  tapmode="" onclick="goback()"><img src="../image/btn/back.png" alt=""></div>
          <div class="title" id="title">舆情分析</div>
            </div>       
       </div>           
      <div id="main">       
      </div>      
      <div id="footer">         
           <span id ="preview" tapmode="active" onclick="openFrame(0)" class="preview act">舆情报告</span>
           <span id="code" tapmode="active" onclick="openFrame(1)" class="">数据统计</span> 
      </div>
    </div>
   <input id="deal_status" type="hidden" value="0"/>
  </body>
<script type="text/javascript" src="../script/api.js"></script>
<script type="text/javascript" src="../script/api.data.js"></script>
<script type="text/javascript" src="../script/jquery.md5.js"></script>
<script type="text/javascript" src="../script/jquery.min.js"></script>
 
<script type="text/javascript">
    apiready = function(){    
         //获取头部和底部的相关信息，计算子窗口的高度及y坐标
         header = $api.byId('thridHeader');       
         $api.fixIos7Bar(header);     
         headerOffset = $api.offset(header);
                 
        // 第一次进入打开 默认显示舆情报告         
        openFrame(0);     
    };

    //打开子窗口
    function openFrame(status){
        var deal_status = $("#deal_status").val();									   
	    if(status != deal_status){
            api.closeFrame({name:"unifiedList"});
        }//判断当前显示内容是否为即将访问的内容,如果切换了菜单则关闭上一个窗口
		$("#deal_status").val(status);	
        if(status == "0"){
            document.getElementById("preview").className = "preview act";
            document.getElementById("code").className = "code";           
            var category = "report";
        }else{ 
            document.getElementById("code").className = "code act";
            document.getElementById("preview").className = "preview";
            var category = "statistics"; //数据统计列表        
        }  
        
        openList(category);            
    }
    
    //打开子窗口列表页面
    function openList(category){ 
         // 打开列表 
         var height = 100;
         var h = 150;
          if("ios" == api.systemType && parseInt(api.systemVersion) >= 7){
            height = parseInt(height)+20;
            h = 170;
         }
         
         api.openFrame ({
             name: 'unifiedList',
             url: './unifiedList.html',
             rect:{
                 x:0,
                 y:height,
                 w:'auto',
                 h:api.frameHeight-h
             },
             delay: 300,
             pageParam: {category:category},
             vScrollBarEnabled:true,          
             hScrollBarEnabled:false,  
             scaleEnabled:true,           
         });
    
    }
    
 
   
    // ===================================
    // 响应底部按钮的切换frame
    // ===================================
   function openWin(category){    
                         
        api.openWin({
            name: 'unifiedWin',
            url: './unifiedWin.html',
            delay: 300,
            bounces: false,
            vScrollBarEnabled:false,
            hScrollBarEnabled:true,
            pageParam: {category:category}
        });    
   }
   
   
   function goback () {
      api.closeWin({name:'analysisWin'});
    }

  
  </script>
</html>